//api文件仍保留但不建议使用，推荐使用models中的api。API files remain preserved (deprecated), use models APIs instead.
import type { Link, LinkResponse } from './types.js';

import { requestClient } from '#/api/request';

export const getuctooLinkList = async (page: number, pageSize: number,
  searchParams?: any) => {
  return requestClient.get<LinkResponse>(`/uctoo/link/${pageSize}/${page}`,{
    params: searchParams,
  });
};

export const getuctooLink = async (id: string) => {
  return requestClient.get<Link>(`/uctoo/link/${id}`);
};

export const adductooLink = async (data: Partial<Link>) => {
  return requestClient.post<Link>('/uctoo/link/add', data);
};

export const edituctooLink = async (data: Partial<Link>) => {
  return requestClient.post<Link>('/uctoo/link/edit', data);
};

export const deleteuctooLink = async (id: string) => {
  return requestClient.post<any>('/uctoo/link/del', { id });
};
